<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //条件判断
    let xhs=5,xg=1;
    if(xg>0){
        xhs=1;
    }
    console.log(xhs);
    /* if(条件表达式){
         条件为真
     }else{
         条件不为真
     } 
    */ 
   //取两个值中的最大值
   let shu_1=10,shu_2=100,max;
   if(shu_1>shu_2){
       max=shu_1;
   }else{
       max=shu_2;
   }
   console.log('最大值是：',max);
   console.log('---------------');

   let num_1=prompt('请输入第一个数');
   let num_2=prompt('请输入第二个数'),max_1;
   if(num_1>num_2){
         max_1=num_1;
   }else if(num_2>num_1){
         max_1=num_2;
   }else{
        console.log('两个值相等');
   }
   console.log('最大值是：',max_1);
</script>
</html>